<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>子窗口</title>
</head>
<body>
  <div>子窗口向父窗口传递数据</div>
  <button id="popbtn">子窗口向父窗口传递数据</button>
  <script src="./render/popup.js"></script>
  <script>
    const popbtn = document.querySelector('#popbtn')
    popbtn.onclick = function() {
      window.opener.postMessage('叫爸爸')
    }
  </script>
</body>
</html>